doc || !path
};
- debug!("fingerprint at: {}", new_loc.display());
+ info!("fingerprint at: {}", new_loc.display());
// First bit of the freshness calculation, whether the dep-info file
// indicates that the target is fresh.
// Second bit of the freshness calculation, whether rustc itself, the
// target are fresh, and the enabled set of features are all fresh.
let features = cx.resolve.features(pkg.get_package_id());
- let features = features.map(|s| s.iter().collect::<Vec<&String>>());
+ let features = features.map(|s| {
+ let mut v = s.iter().collect::<Vec<&String>>();
+ v.sort();
+ v
+ });
let rustc_fingerprint = if use_pkg {
mk_fingerprint(cx, &(target, try!(calculate_pkg_fingerprint(cx, pkg)),
features))
let old_loc = old.join("build");
let new_loc = new.join("build");
- debug!("fingerprint at: {}", new_loc.display());
+ info!("fingerprint at: {}", new_loc.display());
let new_fingerprint = try!(calculate_build_cmd_fingerprint(cx, pkg));
let new_fingerprint = mk_fingerprint(cx, &new_fingerprint);
match fs::stat(&pkg.get_root().join(file)) {
Ok(stat) if stat.modified <= mtime => {}
Ok(stat) => {
- debug!("stale: {} -- {} vs {}", file, stat.modified, mtime);
+ info!("stale: {} -- {} vs {}", file, stat.modified, mtime);
return Ok(false)
}
- _ => { debug!("stale: {} -- missing", file); return Ok(false) }
+ _ => { info!("stale: {} -- missing", file); return Ok(false) }
}
}
use support::{project, execs, cargo_dir};
use support::COMPILING;
+use support::paths::PathExt;
use hamcrest::assert_that;
fn setup() {
{compiling} foo v0.0.1 ({dir})
", compiling = COMPILING, dir = p.url()).as_slice()));
})
+
+test!(many_features_no_rebuilds {
+ let p = project("foo")
+ .file("Cargo.toml", r#"
+ [package]
+ name = "b"
+ version = "0.1.0"
+ authors = []
+
+ [dependencies.a]
+ path = "a"
+ features = ["fall"]
+ "#)
+ .file("src/main.rs", "fn main() {}")
+ .file("a/Cargo.toml", r#"
+ [package]
+ name = "a"
+ version = "0.1.0"
+ authors = []
+
+ [features]
+ ftest = []
+ ftest2 = []
+ fall = ["ftest", "ftest2"]
+ "#)
+ .file("a/src/lib.rs", "");
+
+ assert_that(p.cargo_process("build"),
+ execs().with_status(0).with_stdout(format!("\
+{compiling} a v0.1.0 ({dir})
+{compiling} b v0.1.0 ({dir})
+", compiling = COMPILING, dir = p.url()).as_slice()));
+ p.root().move_into_the_past().unwrap();
+
+ assert_that(p.process(cargo_dir().join("cargo")).arg("build"),
+ execs().with_status(0).with_stdout(""));
+})